<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/yuanqing/material/mes_material.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/yuanqing/material/mes_material.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '原材料请购单',
                name: 'material/mes_material',
                url: "/mes_material/",
                sortName: "id"
            });
            const editFormFields = ref({"m_name":"","remark":"","create_time":"","price":"","t_name":"","kucun":"","mean_price":"","main_unit":"","auxiliary_unit":""});
            const editFormOptions = ref([[{"title":"名称","field":"m_name"},
                               {"title":"备注","field":"remark"},
                               {"title":"创建时间","field":"create_time"}],
                              [{"title":"单价","field":"price","type":"decimal"},
                               {"title":"分类名称","field":"t_name"},
                               {"title":"库存","field":"kucun","type":"decimal"}],
                              [{"title":"加权平均价格","field":"mean_price","type":"decimal"},
                               {"title":"默认单位","field":"main_unit"},
                               {"title":"辅助单位","field":"auxiliary_unit"}]]);
            const searchFormFields = ref({"m_name":"","create_time":"","status":"","t_name":""});
            const searchFormOptions = ref([[{"title":"名称","field":"m_name","type":"like"},{"title":"创建时间","field":"create_time","type":"datetime"},{"title":"状态","field":"status","type":"text"},{"title":"分类名称","field":"t_name","type":"text"}]]);
            const columns = ref([{field:'id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'m_name',title:'名称',type:'string',width:220,align:'left',sort:true},
                       {field:'m_number',title:'条码',type:'string',width:220,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'create_time',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'min_count',title:'库存预警最小数量',type:'int',width:110,align:'left'},
                       {field:'price',title:'单价',type:'decimal',width:110,align:'left'},
                       {field:'status',title:'状态',type:'int',width:110,align:'left'},
                       {field:'t_id',title:'所属分类id',type:'int',width:110,align:'left'},
                       {field:'t_name',title:'分类名称',type:'string',width:220,align:'left'},
                       {field:'kucun',title:'库存',type:'decimal',width:110,align:'left'},
                       {field:'mean_price',title:'加权平均价格',type:'decimal',width:110,align:'left'},
                       {field:'main_unit',title:'默认单位',type:'string',width:220,align:'left'},
                       {field:'auxiliary_unit',title:'辅助单位',type:'string',width:220,align:'left'},
                       {field:'conversion',title:'转换关系',type:'decimal',width:110,align:'left'},
                       {field:'texture',title:'规格',type:'string',width:220,align:'left'},
                       {field:'quality_period',title:'材质',type:'int',width:110,align:'left'},
                       {field:'floating_ratio',title:'保质期',type:'decimal',width:110,align:'left'},
                       {field:'texture_of_material',title:'上浮比例',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
